package team.seekers.catering.config.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import team.seekers.catering.config.entity.Config;
import team.seekers.catering.config.service.ConfigService;

/**
 * 配置表 前端控制器
 */
@RestController
@RequestMapping("/catering/config")
public class ConfigController {

    @Autowired
    private ConfigService configService;

    @Scheduled(cron = "0 58 23 * * ?")
    public void logTodayData() {
        Config byId = configService.getById("1495060882004656129");
        byId.setValue("0");
        configService.updateById(byId);

        Config byId1 = configService.getById("1");
        byId1.setValue("0");
        configService.updateById(byId1);
    }

}

